package per.jdz.single;

/**
 * 静态内部类
 */
public class Holder {
    private Holder() {
        System.out.println(Thread.currentThread().getName());
    };

    public static Holder getInstance() {
        return InnerHolder.HOLDER;
    }
    private static class InnerHolder {
        public final static Holder HOLDER = new Holder();        
    }

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(()-> {
                Holder.getInstance();
            }).start();
        }
   }
}
